<h3>List sản phẩm</h3>
<style type="text/css">
#pagination{
	padding-top:7px
}
#pagination a,
span.current{
	text-decoration:none;
	padding:0px 10px;
	border:1px solid #CCC;
	border-radius:3px;
	margin-right:3px;
}
span.current{
	color:#F00;
	font-weight:bold
}
td{
	border:1px solid #060;
	padding:3px 5px
}
tr.title td{
	height:22px;
	font-weight:bold;
	text-align:center;
	background:#060;
	color:#FFF
}
.red{
	color:#F00
}
</style>
<script type="text/javascript">
$(document).ready(function(){
    $(".del").click(function(){
		if(confirm("Bạn có muốn xóa không?")){
			$id = $(this).attr("name");
			$(this).parent().parent().fadeOut("slow");
			$.ajax({
				"url" : "modules/users/delajax.php",
				"type" : "post",
				"data" : "uid="+$id,
				"async" : false,
				success : function(result){
				}
			});	
		}
		return false;
	});
});
</script>
<div style="height:30px"></div>
<?php
require("libraries/product.php");
$product = new product();
$listpro = $product->listpro();
//debug($listpro);
?>
<table width="709" border="0">
  <tr class="title">
    <td width="36">Stt</td>
    <td width="259">Name</td>
    <td width="100">Price</td>
    <td width="64">Hot</td>
    <td width="148">Category</td>
    <td width="28">Edit</td>
    <td width="44">Del</td>
  </tr>
  <?php $stt = 1; ?>
  <?php foreach($listpro as $items){ ?>
  <tr>
    <td><?php echo $stt; ?></td>
    <td><?php echo $items['pro_name']; ?></td>
    <td><?php echo $items['pro_price']; ?></td>
    <td><?php if($items['pro_hot'] == 1){ echo "Yes";}else{ echo "No";}  ?></td>
    <td><?php echo $items['cate_name']; ?></td>
    <td><a href="<?php echo baseurl."admin/?page=product&act=edit&id=".$items['pro_id']; ?>">Sửa</a></td>
    <td><a class="del" name="<?php echo $items['pro_id']; ?>" href="javascript:void(0)">Xóa</a></td>
  </tr>
  <?php $stt++; } ?>
</table>